import {request} from '@/utils/request' 

// 路线分页列表查询
export const trafficRoute = <T>(id?:T) => { 
	// console.log('traffic',data);
    return request({
        url:"merchant/traffic/client/route/location/"+id,
        method:"GET", 
    });
};

// 路线分页列表查询
export const gettraffic = <T>(data?:T) => { 
	// console.log('traffic',data);
    return request({
        url:"merchant/traffic/client/product",
        method:"POST",
        data:JSON.stringify(data)
    });
};

// 产品最低价 - 根据产品ID
export const getprice = <T>(data?:T) => { 
	// console.log('traffic',data);
    return request({
        url:"merchant/price/product/min",
        method:"POST",
        data:JSON.stringify(data)
    });
};

// 出发地目的地查询
export const getStartAndEnd = <T>(type?:T) => {  
    return request({
        url:"merchant/traffic/client/route?type="+type,
        method:"GET"
    });
};

// 直通车详情查询车型分页列表查询
export const trafficDetail = <T>(id?:T) => {  
    return request({
        url:"merchant/traffic/client/product/"+id,
        method:"GET"
    });
};

// 车型分页列表查询
export const carModelLst = <T>(data?:T) => { 
	console.log('traffic',data);
    return request({
        url:"merchant/traffic/carModel/client",
        method:"POST",
        data:JSON.stringify(data)
    });
};

// 车型详情查询
export const carModelDetail = <T>(id?:T) => {  
    return request({
        url:"merchant/traffic/carModel/client/"+id,
        method:"GET"
    });
};
// 订单提交
export const rentCarOrder = <T>(data?:T) => { 
	// console.log('traffic',data);
    return request({
        url:"merchant/traffic/client/carRental",
        method:"POST",
        data:JSON.stringify(data)
    });
};

// 订单提交
export const commitOrder = <T>(data?:T) => { 
	// console.log('traffic',data);
    return request({
        url:"order/client/traffic",
        method:"POST",
        data:JSON.stringify(data)
    });
};

// 支付
export const toPay = <T>(data?:T) => {
    return request({
        url:"order/pay/wx/toPay",
        method:"POST",
        data,
    });
};